import { FC } from 'react'
import { Modal, Text, View } from 'react-native'
import ImageViewer from 'react-native-image-zoom-viewer'

interface ImageViewProps {
  images: any[]
  visible: boolean
  onClose: () => void
}
const ImageView: FC<ImageViewProps> = ({ images, visible, onClose }) => {
  const onLongPress = image => {
    console.log('onLongPress', image)
  }
  return (
    <Modal animationType="slide" transparent={true} visible={visible}>
      <ImageViewer
        imageUrls={images}
        index={0}
        enableSwipeDown={true}
        onCancel={onClose}
        onClick={onClose}
        saveToLocalByLongPress={false}
        onLongPress={onLongPress}
        // onRequestClose={onClose}
        // onLongPress={onLongPress}
        // HeaderComponent={({ imageIndex }) => <Text>{imageIndex}</Text>}
      />
    </Modal>
  )
}

export default ImageView
